<?php

// Include the package
require_once('Cache_Lite/Lite.php');

$options = array(
    		'cacheDir' => DIR_FS_CATALOG_CACHE,
    		'lifeTime' => null,
		'fileNameProtection' => false
	);

// Create a Cache_Lite object
$Cache_Lite = new Cache_Lite($options);

function read_cache($id, $group)
{
	global $Cache_Lite;
	$return = $Cache_Lite->get($id, $group);
	//if ($return) var_dump($group . ' ' . $id . ' found');
	return $return;
}

function write_cache($data, $id, $group)
{
	global $Cache_Lite;
	return $Cache_Lite->save($data, $id, $group);
}

function remove_cache($id, $group)
{
	global $Cache_Lite;
	return $Cache_Lite->remove($id, $group);
}

function clean_cache($group = false, $mode = 'ingroup')
{
	global $Cache_Lite;
	return $Cache_Lite->clean($group, $mode);
}
?>
